#!/bin/bash

cat $1 |
	sed 's/\/\/\(.*\)$/\/\*\1\ *\//' |
	sed 's/^[ 	]*\(.*\)/\1/' |
	sed 's/[ 	]\+$//'|
	egrep -v '^(int|void|char|double|float|signed|unsigned|long)[ 	]+[^ 	]+[ 	]*\(.*\);' |
	gawk -f awkSepBrace |
	nawk -f awkStruct |
	sed '1!G;h;$!d' | 
	nawk -f awkCtoKRFor | sed '1!G;h;$!d' | 
	sed 's/^{\([^ 	]\{1\}\)/{\
\1/g' |
	nawk -v NUM=4 -f awkIndent |
	nawk -f awkCtoKRFunc 
